<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if !IE]><!-->
<html lang="zh">
<!--<![endif]-->
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>

<head>
    <meta charset="utf-8" />
    <title>保险代理后台管理系统</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />
    <!-- ================== BEGIN BASE CSS STYLE ================== -->
    <jsp:include page="../common/header.jsp"></jsp:include>
    <%@include file="../common/taglib.jsp"%>
    <!-- ================== END BASE CSS STYLE ================== -->

    <!-- ================== 单独作用于本页表格td ================== -->
    <!-- ================== 单独作用于本页表格td ================== -->

    <style type="text/css">
        img {
            cursor: pointer;
        }

        .control-label{width: 144px;}
        .col-md-9{width: 300px;}
        .pager.bwizard-buttons {
            margin-left: 158px;
        }
    </style>
</head>
<body>
<!-- begin #page-loader -->
<div id="page-loader" class="fade in"><span class="spinner"></span></div>
<!-- end #page-loader -->

<!-- begin #page-container -->
<div id="page-container" class="fade page-sidebar-fixed page-header-fixed">
    <jsp:include page="../common/top.jsp"/>

    <!-- begin #sidebar -->
    <jsp:include page="../common/sitebar.jsp"/>
    <div class="sidebar-bg"></div>
    <!-- end #sidebar -->

    <!-- begin #content -->
    <div id="content" class="content">
        <div class="row">
            <!-- begin col-12 -->
            <div class="col-md-12">
                <!-- begin panel -->
                <div class="panel panel-inverse">

                    <div class="panel-body">
                        <form action="/channel/update" method="POST" data-parsley-validate="true" name="form-wizard" enctype="multipart/form-data" class="form-horizontal">
                            <input type="hidden" value="2" name="type" >
                            <input type="hidden" name="tid" value="${channel.tid}">
                            <input type="hidden" name="userId" value="${channel.userId}">
                            <div id="wizard">
                                <ol>
                                    <li>
                                        公司工商信息
                                        <small></small>
                                    </li>
                                    <li>
                                        账户信息
                                        <small></small>
                                    </li>
                                    <li>
                                        附件
                                        <small></small>
                                    </li>
                                    <li>
                                        完成
                                        <small></small>
                                    </li>
                                </ol>
                                <!-- begin wizard step-1 -->
                                <div class="wizard-step-1 active in">
                                    <fieldset>
                                        <!-- begin row -->
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">注册名称：</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" readonly="readonly" name="companyRegisterName" value="${channel.companyRegisterName}" data-parsley-validate="true"
                                                       data-parsley-required-message="请输入注册名称"   data-parsley-maxlength="50"  data-parsley-maxlength-message="注册名称最长为50个字符" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">企业信用统一代码：</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" name="creditCode" value="${channel.creditCode}"  data-parsley-creditcode="true"  data-parsley-group="wizard-step-1"  maxlength="18" data-parsley-required="true"
                                                       data-parsley-required-message="请输入企业信用统一代码" data-parsley-creditcode-message="企业信用统一代码填写有误,请重新填写" data-parsley-maxlength="18" data-parsley-maxlength-message="企业信用统一最长为18位" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">注册时间：</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control selectData" name="companyRegisterDate" value="${channel.companyRegisterDate}"  data-parsley-group="wizard-step-1"  required data-parsley-required-message="请输入注册时间"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">营业期限：</label>
                                            <div class="col-md-3">
                                                <input type="text" class="form-control selectData" name="businessStartDate" value="${channel.businessStartDate}" required
                                                       data-parsley-required="true"
                                                       data-parsley-required-message="请输入营业期限"
                                                       data-parsley-group="wizard-step-1"/>
                                            </div>
                                            <label class="col-sm-1 control-label"> 至 </label>
                                            <div class="col-md-3">
                                                <input type="text" class="form-control selectData" name="businessEndDate" value="${channel.businessEndDate}" required
                                                       data-parsley-required="true"
                                                       data-parsley-required-message="请输入营业期限"
                                                       data-parsley-group="wizard-step-1"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">法人姓名：</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" name="legalPerson.name" value="${channel.legalPerson.name}"
                                                       data-parsley-required="true"
                                                       data-parsley-legalpersonname="true"
                                                       data-parsley-group="wizard-step-1"
                                                       data-parsley-required-message="请输入法人姓名"
                                                       data-parsley-legalpersonname-message="法人姓名填写有误,请重新填写"
                                                       data-parsley-maxlength="24"
                                                       maxlength="24"
                                                       data-parsley-maxlength-message="法人姓名最长为24个字符" />

                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">法人身份证号：</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" name="legalPerson.idNo" value="${channel.legalPerson.idNo}"
                                                       data-parsley-required="true"
                                                       data-parsley-legalpersonidno="true"
                                                       data-parsley-group="wizard-step-1"
                                                       data-parsley-required-message="请输入法人身份证号"
                                                       data-parsley-legalpersonidno-message="身份证号填写有误,请重新填写"
                                                       data-parsley-maxlength="18"
                                                       maxlength="18"
                                                       data-parsley-maxlength-message="法人身份证号最长为18位" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">法人手机号：</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" name="legalPerson.mobile" value="${channel.legalPerson.mobile}"
                                                       data-parsley-required="true"
                                                       data-parsley-legalpersonmobile="true"
                                                       data-parsley-group="wizard-step-1"
                                                       data-parsley-required-message="请输入法人手机号"
                                                       data-parsley-legalpersonmobile-message="手机号填写有误,请重新填写"
                                                       data-parsley-maxlength="11"
                                                       maxlength="11"
                                                       data-parsley-maxlength-message="法人手机号最长为11位" />
                                            </div>
                                        </div>
                                        <c:if test="${channel.actualController.name != null}">
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">实际控制人姓名：</label>
                                                <div class="col-md-9">
                                                    <input type="text" class="form-control" name="channel.actualController.name" value="${channel.actualController.name}"
                                                           data-parsley-required="true"
                                                           data-parsley-legalpersonname="true"
                                                           data-parsley-group="wizard-step-1"
                                                           data-parsley-required-message="请输入实际控制人姓名"
                                                           data-parsley-legalpersonname-message="实际控制人姓名填写有误,请重新填写"
                                                           data-parsley-maxlength="24"
                                                           maxlength="24"
                                                           data-parsley-maxlength-message="实际控制人姓名最长为24个字符"   />
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">实际控制人身份证号：</label>
                                                <div class="col-md-9">
                                                    <input type="text" class="form-control" name="channel.actualController.idNo" value="${channel.actualController.idNo}"
                                                           data-parsley-required="true"
                                                           data-parsley-legalpersonidno="true"
                                                           data-parsley-group="wizard-step-1"
                                                           data-parsley-required-message="请输入实际控制人身份证号"
                                                           data-parsley-legalpersonidno-message="身份证号填写有误,请重新填写"
                                                           data-parsley-maxlength="18"
                                                           maxlength="18"
                                                           data-parsley-maxlength-message="实际控制人身份证号最长为18位"     />
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">实际控制人手机号：</label>
                                                <div class="col-md-9">
                                                    <input type="text" class="form-control" name="channel.actualController.mobile" value="${channel.actualController.mobile}"
                                                           data-parsley-required="true"
                                                           data-parsley-legalpersonmobile="true"
                                                           data-parsley-group="wizard-step-1"
                                                           data-parsley-required-message="请输入实际控制人手机号"
                                                           data-parsley-legalpersonmobile-message="手机号填写有误,请重新填写"
                                                           data-parsley-maxlength="11"
                                                           maxlength="11"
                                                           data-parsley-maxlength-message="实际控制人手机号最长为11位" />
                                                </div>
                                            </div>

                                        </c:if>

                                        <c:forEach items="${channel.seniorManagerList}" var="member" varStatus="st">
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">高管姓名：</label>
                                                <div class="col-md-9">
                                                    <input type="text" class="form-control" name="seniorManagerList['${st.index}'].name" value="${member.name}"
                                                           data-parsley-required="true"
                                                           data-parsley-legalpersonname="true"
                                                           data-parsley-group="wizard-step-1"
                                                           data-parsley-required-message="请输入高管姓名"
                                                           data-parsley-legalpersonname-message="高管姓名填写有误,请重新填写"
                                                           data-parsley-maxlength="24"
                                                           maxlength="24"
                                                           data-parsley-maxlength-message="法人姓名最长为24个字符" />
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">高管身份证号：</label>
                                                <div class="col-md-9">
                                                    <input type="text" class="form-control" name="seniorManagerList['${st.index}'].idNo" value="${member.idNo}"
                                                           data-parsley-required="true"
                                                           data-parsley-legalpersonidno="true"
                                                           data-parsley-group="wizard-step-1"
                                                           data-parsley-required-message="请输入高管身份证号"
                                                           data-parsley-legalpersonidno-message="身份证号填写有误,请重新填写"
                                                           data-parsley-maxlength="18"
                                                           maxlength="18"
                                                           data-parsley-maxlength-message="高管身份证号最长为18位"/>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">高管手机号：</label>
                                                <div class="col-md-9">
                                                    <input type="text" class="form-control" name="seniorManagerList['${st.index}'].mobile" value="${member.mobile}"
                                                           data-parsley-required="true"
                                                           data-parsley-legalpersonmobile="true"
                                                           data-parsley-group="wizard-step-1"
                                                           data-parsley-required-message="请输入高管手机号"
                                                           data-parsley-legalpersonmobile-message="手机号填写有误,请重新填写"
                                                           data-parsley-maxlength="11"
                                                           maxlength="11"
                                                           data-parsley-maxlength-message="高管手机号最长为11位" />
                                                </div>
                                            </div>

                                        </c:forEach>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">公司联系人：</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" name="contact.name" value="${channel.contact.name}"
                                                       data-parsley-required="true"
                                                       data-parsley-legalpersonname="true"
                                                       data-parsley-required-message="请输入公司联系人"
                                                       data-parsley-legalpersonname="true"
                                                       data-parsley-legalpersonname-message="公司联系人姓名填写有误,请重新填写"
                                                       data-parsley-maxlength="24"
                                                       data-parsley-maxlength-message="联系人最长为24个字符"
                                                       data-parsley-group="wizard-step-1"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">联系人电话：</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" name="contact.telephone" value="${channel.contact.telephone}"
                                                       maxlength="13"
                                                       data-parsley-required="true"
                                                       data-parsley-telephone="true"
                                                       data-parsley-telephone-message="电话号码填写有误,请重新填写"
                                                       data-parsley-required-message="请输入联系人电话"
                                                       data-parsley-maxlength="13"
                                                       data-parsley-maxlength-message="联系人电话最长为13位"
                                                       data-parsley-group="wizard-step-1" />
                                            </div>
                                        </div>



                                        <!-- end row -->
                                    </fieldset>
                                </div>
                                <!-- end wizard step-1 -->
                                <!-- begin wizard step-2 -->
                                <div class="wizard-step-2">
                                    <fieldset>
                                        <%--<legend class="pull-left width-full">Member Information</legend>--%>
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">账户开户名：</label>
                                                <div class="col-md-9">
                                                    <input type="text" class="form-control" name="accountName" value="${channel.accountName}"
                                                           data-parsley-accountname="true"
                                                           data-parsley-accountname-message="账户开户名填写有误,请重新填写"
                                                           data-parsley-maxlength="20"
                                                           maxlength="20"
                                                           data-parsley-maxlength-message="账户开户名最长为20个字符"
                                                           data-parsley-group="wizard-step-2" />
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">银行账号: </label>
                                                <div class="col-md-9">
                                                    <input type="text" class="form-control" name="accountNo" value="${channel.accountNo}"
                                                           maxlength="20"
                                                           data-parsley-accountno="true"
                                                           data-parsley-accountno-message="银行账号填写有误,请重新填写"
                                                           data-parsley-minlength="16"
                                                           data-parsley-minlength-message="银行账号最短为16位"
                                                           data-parsley-maxlength="20"
                                                           data-parsley-maxlength-message="银行账号最长为20位"
                                                           data-parsley-group="wizard-step-2"  />
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">所属银行：</label>
                                                <div class="col-md-9">
                                                    <input type="text" class="form-control"  name="bankName" value="${channel.bankName}"
                                                           maxlength="20"
                                                           data-parsley-bankname="true"
                                                           data-parsley-bankname-message="所属银行填写有误,请重新填写"
                                                           data-parsley-group="wizard-step-2"  />
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">开户支行：</label>
                                                <div class="col-md-9">
                                                    <input type="text" class="form-control" name="bankBranchName" value="${channel.bankBranchName}"
                                                           data-parsley-bankbranchname="true"
                                                           data-parsley-bankbranchname-message="开户支行填写有误,请重新填写"
                                                           maxlength="20"
                                                           data-parsley-group="wizard-step-2" />
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">支付宝账号：</label>
                                                <div class="col-md-9">
                                                    <input type="text" class="form-control" name="alipayNo" value="${channel.alipayNo}"
                                                           maxlength="20"
                                                           data-parsley-alipayno="true"
                                                           data-parsley-alipayno-message="支付宝账号填写有误,请重新填写"
                                                           data-parsley-group="wizard-step-2" />
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">微信账号：</label>
                                                <div class="col-md-9">
                                                    <input type="text" class="form-control" name="weChatNo" value="${channel.weChatNo}"
                                                           data-parsley-group="wizard-step-2"
                                                           maxlength="20"
                                                           data-parsley-wechatno="true"
                                                           data-parsley-wechatno-message="微信账号填写有误,请重新填写"
                                                           data-parsley-maxlength="20"
                                                           data-parsley-maxlength-message="微信账号最长为20位"/>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">其它：</label>
                                                <div class="col-md-9">
                                                    <input type="text" class="form-control" name="remark" value="${channel.remark}"  maxlength="100" />
                                                </div>
                                            </div>

                                        <!-- begin row -->
                                        <!-- end row -->
                                    </fieldset>
                                </div>
                                <!-- end wizard step-2 -->
                                <!-- begin wizard step-3 -->
                                <div class="wizard-step-3 formFile">
                                    <div class="form-group" >
                                        <label class="col-md-4 control-label"><strong>附件名</strong></label>
                                        <div class="col-md-4">
                                            <label class="col-md-3 control-label"><strong>文件</strong></label>
                                        </div>
                                        <div class="col-md-4">
                                            <label class="col-md-3 control-label"><strong>操作</strong></label>
                                        </div>
                                    </div>
                                    <fieldset>

                                            <div class="form-group">
                                                <label class="col-md-3 control-label">营业执照：</label>
                                                <div class="col-md-3">
                                                    <input name="businessLicenseFile" type="file">
                                                </div>
                                                <c:forEach items="${attachmentList}" var="attachment">
                                                    <c:if test="${attachment.type == 1}">
                                                        <a href="#" onclick="viewPage('${attachment.url}')">${attachment.name}</a>
                                                        <img src="${ctx}/static/img/del.png" height="30" width="30" alt="删除" onclick="deleteFile('${attachment.tid}')">
                                                    </c:if>
                                                </c:forEach>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">行业许可证： </label>
                                                <div class="col-md-3">
                                                    <input name="industryLicenseFile"  type="file"
                                                           data-parsley-group="wizard-step-3"
                                                           data-parsley-filetype="true"
                                                           data-parsley-filetype-message="附件格式错误,请重新上传">
                                                </div>
                                                <c:forEach items="${attachmentList}" var="attachment">
                                                    <c:if test="${attachment.type == 2}">
                                                        <a href="#" onclick="viewPage('${attachment.url}')">${attachment.name}</a>
                                                        <img src="${ctx}/static/img/del.png" height="30" width="30" alt="删除" onclick="deleteFile('${attachment.tid}')">
                                                    </c:if>
                                                </c:forEach>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">法人身份证：</label>
                                                <div class="col-md-3">
                                                    <input name="legalPersonFile" type="file" data-parsley-group="wizard-step-3"
                                                           data-parsley-filetype="true"
                                                           data-parsley-filetype-message="附件格式错误,请重新上传" multiple>
                                                </div>
                                                <c:forEach items="${attachmentList}" var="attachment">
                                                    <c:if test="${attachment.type == 3}">
                                                        <a href="#" onclick="viewPage('${attachment.url}')">${attachment.name}</a>
                                                        <img src="${ctx}/static/img/del.png" height="30" width="30" alt="删除" onclick="deleteFile('${attachment.tid}')">
                                                    </c:if>
                                                </c:forEach>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">高管身份证：</label>
                                                <div class="col-md-3">
                                                    <input name="seniorManagerFile"  type="file"  data-parsley-group="wizard-step-3"
                                                           data-parsley-filetype="true"
                                                           data-parsley-filetype-message="附件格式错误,请重新上传"  multiple>
                                                </div>
                                                <c:forEach items="${attachmentList}" var="attachment">
                                                    <c:if test="${attachment.type == 4}">
                                                        <a href="#" onclick="viewPage('${attachment.url}')">${attachment.name}</a>
                                                        <img src="${ctx}/static/img/del.png" height="30" width="30" alt="删除" onclick="deleteFile('${attachment.tid}')">
                                                    </c:if>
                                                </c:forEach>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-md-3 control-label">实际控制人身份证：</label>
                                                <div class="col-md-3">
                                                    <input name="actualControllerFile"  type="file"  data-parsley-group="wizard-step-3"
                                                           data-parsley-filetype="true"
                                                           data-parsley-filetype-message="附件格式错误,请重新上传" multiple>
                                                </div>
                                                <c:forEach items="${attachmentList}" var="attachment">
                                                    <c:if test="${attachment.type == 5}">
                                                        <a href="#" onclick="viewPage('${attachment.url}')">${attachment.name}</a>
                                                        <img src="${ctx}/static/img/del.png" height="30" width="30" alt="删除" onclick="deleteFile('${attachment.tid}')">
                                                    </c:if>
                                                </c:forEach>
                                            </div>
                                        <div class="form-group" style="display: none">
                                            <label class="col-md-3 control-label">身份证复印件：</label>
                                            <div class="col-md-9">
                                                <input name="contactsFile" type="file" data-parsley-group="wizard-step-3"
                                                       data-parsley-filetype="true"
                                                       data-parsley-filetype-message="附件格式错误,请重新上传"  multiple>
                                            </div>
                                        </div>

                                            <div  class="form-group" >
                                               <%-- <label class="col-md-3 control-label">自定义附件名称：</label>--%>
                                                <div class="col-md-3  control-label">
                                                    <input type="text"   name="alias" style="width: 114px;" placeholder="自定义附件名称" data-parsley-group="wizard-step-3"
                                                           data-parsley-filetype="true"
                                                           data-parsley-filetype-message="附件格式错误,请重新上传"  />：
                                                </div>

                                                <div class="col-md-3">
                                                    <p class="form-control-static">
                                                        <input name="file"  type="file">
                                                    </p>
                                                </div>
                                            </div>


                                            <div id="addFile1" class="selectWrap" style="display:none">
                                            <div  class="form-group" >
                                                <%-- <label class="col-md-3 control-label">自定义附件名称：</label>--%>
                                                <input type="text" style="width: 114px"  class="col-md-3 control-label" name="alias" placeholder="自定义附件名称" />：
                                                <div class="col-md-9">
                                                    <input type="hidden" name="fileType" value="6">
                                                    <p class="form-control-static">
                                                    <input name="file"  type="file" data-parsley-group="wizard-step-3"
                                                           data-parsley-filetype="true"
                                                           data-parsley-filetype-message="附件格式错误,请重新上传" >
                                                    </p>
                                                </div>
                                            </div><a href="javascript:;" onclick="delFile()" class="delFile">删除</a>
                                            </div>
                                            <div class="form-group" id="fileAdd">
                                                <label class="col-md-3 control-label"></label>
                                                <div class="col-md-9">
                                                    <a class="btn btn-sm btn-primary" id="addFile"> + 添加附件</a>
                                                </div>
                                            </div>
                                            <!-- begin row -->
                                            <!-- end col-4 -->
                                            <!-- end col-6 -->
                                        <!-- end row -->
                                    </fieldset>
                                </div>
                                <!-- end wizard step-3 -->
                                <!-- begin wizard step-4 -->
                                <div>
                                        <div class="p-t-20">
                                            <div class="text-center">
                                                <img src="${ctx}/static/img/ico-ok.png" alt="">
                                                <p style="    position: relative;top: 6px;">已完成信息编辑！</p>
                                            </div>
                                            <footer style="position: relative; top: 60px; top: 68px;  margin-left: 98px;">
                                                <button type="submit" class="btn btn-primary m-r-10">提交</button>
                                                <button type="button" class="btn btn-default">取消</button>
                                            </footer>
                                        </div>
                                </div>
                                <!-- end wizard step-4 -->
                            </div>
                            <div class="form-group">
                                <label class="col-md-3 control-label" style=" width: 158px;">业务员：</label>
                                <div class="col-md-9">
                                    <%--  <input type="text" class="form-control" placeholder="Default input" />--%>
                                    <input type="hidden" class="form-control" id="userName" name="userName" value="${channel.masterUser.realName}">
                                        <select class="form-control" id="userId" name="masterUserId" onchange="setName();" placeholder="业务员"  data-parsley-required="true"
                                                data-parsley-required-message="业务员不能为空" style="width: 164px;">
                                        <option value="">请选择</option>
                                        <c:forEach items="${list}" var="us">
                                            <option value="${us.tid}" <c:if test="${ us.tid == channel.masterUserId}"> selected="selected" </c:if>>${us.username}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                            </div>
                        </form>
                    </div>
                    <!-- end panel -->
                </div>
                <div class="modal fade" id="modal-subInfo">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                <h4 class="modal-title">提示</h4>
                            </div>
                            <div id="showSubInfo" class="modal-body">
                                确认删除？
                            </div>
                            <div class="modal-footer">
                                <a href="javascript:;" id="subButtonYes" class="btn btn-sm btn-primary">确定</a>
                                <a href="javascript:;" id="subButtonNo" class="btn btn-sm btn-default" data-dismiss="modal">取消</a>
                            </div>
                        </div>
                    </div>
                </div>


            </div>
            <!-- end col-12 -->
        </div>
        <!-- end row -->
    </div>

    <!-- end #content -->

</div>
<!-- end page container -->
<jsp:include page="../common/footer.jsp"/>

<!-- ================== END PAGE LEVEL JS ================== -->


<script src="${ctx}/static/js/channel/channel_edit.js"></script>
<script>

    //时间插件配置
    $(".selectData").datepicker({
        autoclose: true, //自动关闭
        beforeShowDay: $.noop, //在显示日期之前调用的函数
        calendarWeeks: false, //是否显示今年是第几周
        clearBtn: false, //显示清除按钮
        daysOfWeekDisabled: [], //星期几不可选
        endDate: Infinity, //日历结束日期
        forceParse: true, //是否强制转换不符合格式的字符串
        format: 'yyyy-mm-dd', //日期格式
        keyboardNavigation: true, //是否显示箭头导航
        language: "zh-CN", //语言
        minViewMode: 0,
        orientation: "auto", //方向
        rtl: false,
        startDate: -Infinity, //日历开始日期
        startView: 0, //开始显示
        todayBtn: false, //今天按钮
        todayHighlight: true, //今天高亮
        weekStart: 0 //星期几是开始
    });


    //删除附件
    function delFile() {
        if(confirm("确认删除该附件？")) {
            $(document).on('click', '.delFile', function () {
                $(this).closest('.selectWrap').remove();
            })
        }
    }
    // 更多附件，新增附件
    $("#addFile").click(function(){
        var div = $("#addFile1");
        var clone = div.clone().show();
        var fileAdd = $("#fileAdd");
        clone.insertBefore(fileAdd);
    });
    // 更多附件，新增附件
    $("#addFiles2").click(function(){
        var div = $("#addFile2");
        var clone = div.clone().show();
        var fileAdd2 = $("#fileAdd2");
        clone.insertBefore(fileAdd2);
    });

    //去往编辑页面
    function toedit(id){
        window.location.href="<%=path%>/sysuser/toedit/"+id;
    }

    //去往新增页面
    function toadd(){
        window.location.href="<%=path%>/sysuser/toadd";
    }

    function showInfo(){
        /*  var fTypeCheck = false;
         var fCheck = false;
         $("[name='fileType']").each(function(){
         var fType = $(this).val();
         if(""==fType){
         fTypeCheck = true;
         }
         });
         $("[name='file']").each(function(){
         var fl = $(this).val();
         if(""==fl){
         fCheck = true;
         }
         });*/
        /*if(fTypeCheck){
         $("#showSubInfo").html("附件类型不能为空，请选择后重试");
         $("#subButtonYes").attr("onclick","closeSelfModal()");
         $("#infoModal").modal('show');
         return false;
         }*/
        /* if(fCheck){
         $("#showSubInfo").html("附件不能为空，请选择后重试");
         $("#subButtonYes").attr("onclick","closeSelfModal()");
         $("#infoModal").modal('show');
         return false;
         }*/
        $("#showSubInfo").html("确定要提交吗？");
        $("#subButtonYes").attr("onclick","submitInfos()");
        $("#infoModal").modal('show');
    }

    function submitInfos(){
        $("#subButtonYes").removeAttr("onclick");
        $("#infoModal").modal('hide');
        $("#submitForm").ajaxSubmit({
            type: "POST",
            url:"/channel/save",
            success: function(data){
                if(data.type =="S"){
                    $("#showSubInfo").html(data.message);
                    $("#subButtonYes").attr("onclick","reload()");
                    $("#infoModal").modal('show');
                }else{
                    $("#showSubInfo").html(data.message);
                    $("#infoModal").modal('show');
                }
            }
        });
    }
    window.ParsleyValidator.addValidator('companyname', function(value) {
        if(value!= ""){
            return /^[a-zA-Z0-9\u4E00-\u9FA5]+$/.test(value);
        }
        return true;
    },32);

    window.ParsleyValidator.addValidator('creditcode', function(value) {
        if(value!= ""){
            return /[A-Z0-9]{18}/g.test(value);
        }
        return true;
    },32);

    window.ParsleyValidator.addValidator('legalpersonname', function(value) {
        if(value!= ""){
            return /^[\u0391-\uFFE5A-Za-z]+$/.test(value);
        }
        return true;
    },32);

    window.ParsleyValidator.addValidator('legalpersonidno', function(value) {
        if(value!= ""){
            return /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(value);
        }
        return true;
    },32);
    window.ParsleyValidator.addValidator('legalpersonmobile', function(value) {
        if(value!= ""){
            return /^1\d{10}$/.test(value);
        }
        return true;
    },32);
    window.ParsleyValidator.addValidator('telephone', function(value) {
        if(value!= ""){
            var b = value.length;
            return (b == 11 &&  /^1\d{10}$/.test(value)) || (b >= 10 && b <= 13 && /^0\d{2}-\d+$/.test(value))
                || (b >= 10 && b <= 13 && /^0\d{3}-\d+$/.test(value) || (b >= 10 && b <= 13 && /^0\d{2}\d+$/.test(value)));
        }
        return true;
    },32);

    window.ParsleyValidator.addValidator('only',function (jobNumber){
        var result = true;
        if(jobNumber!="" && jobNumber!=null){
            $.ajax({
                type:"post",
                url:"/channel/onlyJobNumber",
                async:false,
                data:{jobNumber:jobNumber},
                success:function (msg){
                    if(msg.success!=true){
                        result = false;
                    }
                }
            });
        }
        return result;
    },32);

    window.ParsleyValidator.addValidator('jobnumber', function(value) {
        if(value!= ""){
            return /^[0-9a-zA-Z]*$/g.test(value);
        }
        return true;
    },32);

    window.ParsleyValidator.addValidator('contactcompanyname', function(value) {
        if(value!= ""){
            return /^[A-Za-z0-9\u4e00-\u9fa5]+$/.test(value);
        }
        return true;
    },32);

    window.ParsleyValidator.addValidator('accountname', function(value) {
        if(value!= ""){
            return /^[a-zA-Z\u4e00-\u9fa5]+$/.test(value);
        }
        return true;
    },32);

    window.ParsleyValidator.addValidator('accountno', function(value) {
        if(value!= ""){
            return /^[0-9]*$/.test(value);
        }
        return true;
    },32);

    window.ParsleyValidator.addValidator('bankname', function(value) {
        if(value!= ""){
            return /^[a-zA-Z0-9\u4E00-\u9FA5]+$/.test(value);
        }
        return true;
    },32);

    window.ParsleyValidator.addValidator('bankbranchname', function(value) {
        if(value!= ""){
            return /^[a-zA-Z0-9\u4E00-\u9FA5]+$/.test(value);
        }
        return true;
    },32);

    window.ParsleyValidator.addValidator('alipayno', function(value) {
        if(value!= ""){
            return( /^[a-zA-Z0-9]+$/.test(value) || /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(value)) ;
        }
        return true;
    },32);

    window.ParsleyValidator.addValidator('wechatno', function(value) {
        if(value!= ""){
            return (/^[a-zA-Z][a-zA-Z0-9_-]{5,19}$/.test(value)|| /^[a-zA-Z0-9]+$/.test(value));
        }
        return true;
    },32);

    window.ParsleyValidator.addValidator('filetype', function(value) {
        if(value!= ""){
            return /\.(jpg|pdf|png|doc|docx|JPG|PDF|PNG|DOC|DOCX)$/.test(value);
        }
        return true;
    },32);

    window.ParsleyValidator.addValidator('homeaddress', function(value) {
        if(value!= ""){
            return /^[\u4E00-\u9FA5A-Za-z\d\-]+$/.test(value);
        }
        return true;
    },32);
</script>
</body>
</html>
